import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux'
import './index.less';
import reportWebVitals from './reportWebVitals';
import store from './store'


import { BrowserRouter as Router, Routes, Route, Link } from 'react-router-dom'
import HomePage from './pages/HomePage';
import UserPage from './pages/UserPage';
import LoginPage from './pages/loginPage';
import _404Page from './pages/_404Page';


const Home = () => {
  return (
    <Router>
      <div>
        <ul>
        <li><Link to="/">首页</Link></li>
        <li><Link to="/user">用户中心</Link></li>
        <li><Link to="/myrcform">登录</Link></li>
        </ul>
      <hr />
      <Routes>
        <Route exact path="/" element={<HomePage />} />
        <Route path="/user" element={<UserPage/>} />
        <Route path="/login" element={<LoginPage/>} />
        <Route  element={<_404Page/>} />
      </Routes>
      </div>
    </Router>
  )
}

ReactDOM.render(
  <Provider store={store}>
    <Home />
  </Provider>,
  document.getElementById('root')
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
